package com.standard.logcat.jsonFormatter

import com.google.gson.Gson
import com.google.gson.GsonBuilder
import com.google.gson.JsonParser


object JsonFormatter {

    fun formatter(content: String): String {
        return try {
            val json = JsonParser.parseString(content)
            val gson: Gson = GsonBuilder().setPrettyPrinting().create()
            gson.toJson(json)
        } catch (e: Exception) {
            e.printStackTrace()
            content
        }
    }
}